<template>
  <div class="not-found-view">
    <div class="not-found-container">
      <div class="error-code">404</div>
      <h1 class="error-title">页面不存在</h1>
      <p class="error-message">抱歉，您访问的页面不存在或已被删除</p>
      <div class="error-actions">
        <el-button type="primary" @click="goHome">返回首页</el-button>
        <el-button type="default" @click="goBack">返回上一页</el-button>
      </div>
      <div class="error-suggestion">
        <p>您可能想访问：</p>
        <div class="suggestion-links">
          <router-link to="/" class="suggestion-link">首页</router-link>
          <router-link to="/forum" class="suggestion-link">论坛</router-link>
          <router-link to="/search-question" class="suggestion-link">搜题</router-link>
          <router-link to="/user-profile" class="suggestion-link">个人中心</router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push('/');
};

const goBack = () => {
  router.back();
};
</script>

<style scoped>
/* 不使用变量导入，直接使用具体值 */
.not-found-view {
  min-height: 100vh;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.not-found-container {
  background-color: white;
  border-radius: 4px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 100%;
}

.error-code {
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #409eff, #67c23a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-title {
  font-size: 28px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 16px;
}

.error-message {
  font-size: 16px;
  color: #606266;
  margin-bottom: 30px;
  line-height: 1.5;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

.error-suggestion {
  border-top: 1px solid #ebeef5;
  padding-top: 24px;
}

.error-suggestion p {
  font-size: 14px;
  color: #606266;
  margin-bottom: 16px;
}

.suggestion-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.suggestion-link {
  font-size: 14px;
  color: #409eff;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 2px;
  transition: all 0.3s;
}

.suggestion-link:hover {
  background-color: #ecf5ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .not-found-container {
    padding: 40px 20px;
  }
  
  .error-code {
    font-size: 80px;
  }
  
  .error-title {
    font-size: 24px;
  }
  
  .error-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .suggestion-links {
    flex-direction: column;
    gap: 8px;
  }
}
</style>